import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 智能比对信息 */
export interface InfoComparison {
          id: number; // 主键
          userId?: number; // 用户ID
          deptId?: number; // 部门ID
          name?: string; // 姓名
          mobile?: string; // 手机号
          result?: boolean; // 是否一致（0否 1是）
          queryTime?: string | Dayjs; // 查询时间
  }

// 智能比对 API
export const InfoComparisonApi = {
  // 查询智能比对分页
  getInfoComparisonPage: async (params: any) => {
    return await request.get({ url: `/business/info-comparison/page`, params })
  },

  // 查询智能比对详情
  getInfoComparison: async (id: number) => {
    return await request.get({ url: `/business/info-comparison/get?id=` + id })
  },

  // 新增智能比对
  createInfoComparison: async (data: InfoComparison) => {
    return await request.post({ url: `/business/info-comparison/create`, data })
  },

  // 修改智能比对
  updateInfoComparison: async (data: InfoComparison) => {
    return await request.put({ url: `/business/info-comparison/update`, data })
  },

  // 删除智能比对
  deleteInfoComparison: async (id: number) => {
    return await request.delete({ url: `/business/info-comparison/delete?id=` + id })
  },

  /** 批量删除智能比对 */
  deleteInfoComparisonList: async (ids: number[]) => {
    return await request.delete({ url: `/business/info-comparison/delete-list?ids=${ids.join(',')}` })
  },

  // 导出智能比对 Excel
  exportInfoComparison: async (params) => {
    return await request.download({ url: `/business/info-comparison/export-excel`, params })
  },
}